#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTcpSocket>
#include <QMouseEvent>

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow {
    Q_OBJECT
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();


protected:
    void changeEvent(QEvent *e);
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void keyPressEvent(QKeyEvent *event);
    void keyReleaseEvent(QKeyEvent *event);

private:
    Ui::MainWindow *ui;
    QTcpSocket tcpSocket;
    QPoint lastClick; //location on screen of last click
    int serverResX; // screen resolution (X) of server
    int serverResY;
    QString ip;
    int port;
    quint32 sizeOfData;
    bool firstPacket;
    QPixmap pixmap;
    quint16 pos_x, pos_y;
    quint8 quality;
    quint8 qualityTemp;
    bool firstRun;

private slots:
    void readFromServer();
    void on_pushButton_clicked();
};

#endif // MAINWINDOW_H
